package com.example.common.exception;

import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public class YebException extends RuntimeException {

    private Integer code;

    private String msg;

    public YebException(Integer code, String msg) {

        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public YebException addMessage(String message) {
        this.msg += message;
        return this;
    }

    public YebException addParameterName(String parameterName) {
        this.msg += parameterName + "参数不能为空" ;
        return this;
    }
}
